class Admin::AdminHelpersController < Admin::BaseController
      before_filter :is_administrator
  # GET /admin_helpers
  # GET /admin_helpers.xml
  def index
    @admin_helpers = AdminHelper.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @admin_helpers }
    end
  end

  # GET /admin_helpers/1
  # GET /admin_helpers/1.xml
  def show
    @admin_helper = AdminHelper.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @admin_helper }
    end
  end

  # GET /admin_helpers/new
  # GET /admin_helpers/new.xml
  def new
    @admin_helper = AdminHelper.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @admin_helper }
    end
  end

  # GET /admin_helpers/1/edit
  def edit
    @admin_helper = AdminHelper.find(params[:id])
  end

  # POST /admin_helpers
  # POST /admin_helpers.xml
  def create
    @admin_helper = AdminHelper.new(params[:admin_helper])

    respond_to do |format|
      if @admin_helper.save
        flash[:notice] = 'AdminHelper was successfully created.'
        format.html { redirect_to admin_admin_helpers_path }
        format.xml  { render :xml => @admin_helper, :status => :created, :location => @admin_helper }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @admin_helper.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /admin_helpers/1
  # PUT /admin_helpers/1.xml
  def update
    @admin_helper = AdminHelper.find(params[:id])

    respond_to do |format|
      if @admin_helper.update_attributes(params[:admin_helper])
        flash[:notice] = 'AdminHelper was successfully updated.'
        format.html { redirect_to admin_admin_helpers_path }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @admin_helper.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /admin_helpers/1
  # DELETE /admin_helpers/1.xml
  def destroy
    @admin_helper = AdminHelper.find(params[:id])
    @admin_helper.destroy

    respond_to do |format|
      format.html { redirect_to admin_admin_helpers_path}
      format.xml  { head :ok }
    end
  end
end
